```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Java Switch Case 穿透现象解析</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        .hero {
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
        }
        .code-block {
            background-color: #2d2d2d;
            color: #f8f8f2;
            border-radius: 8px;
            box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        }
        .keyword {
            color: #f92672;
        }
        .string {
            color: #e6db74;
        }
        .number {
            color: #ae81ff;
        }
        .comment {
            color: #75715e;
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 30px rgba(0,0,0,0.15);
        }
        .warning-banner {
            background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
            border-left: 4px solid #ffc107;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero py-20 px-4 md:px-0">
        <div class="container mx-auto max-w-5xl text-center">
            <h1 class="text-4xl md:text-5xl font-bold mb-6 text-gray-800 font-serif">Java <span class="text-blue-600">switch-case</span> 穿透现象解析</h1>
            <p class="text-xl md:text-2xl text-gray-600 max-w-3xl mx-auto leading-relaxed">深入理解Java中switch语句的执行机制与常见陷阱</p>
            <div class="mt-10 flex justify-center">
                <div class="inline-flex items-center px-6 py-3 bg-blue-600 text-white rounded-lg shadow-lg hover:bg-blue-700 transition duration-300">
                    <i class="fas fa-code mr-2"></i>
                    <span>代码示例</span>
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="container mx-auto max-w-5xl px-4 md:px-0 py-16">
        <!-- Code Section -->
        <section class="mb-20">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 border-b pb-2 flex items-center">
                <i class="fas fa-laptop-code mr-3 text-blue-500"></i>
                示例代码分析
            </h2>
            
            <div class="code-block p-6 mb-8 overflow-x-auto">
                <pre><code>
<span class="keyword">int</span> num = <span class="number">1</span>;

<span class="keyword">switch</span> (num) {
    <span class="keyword">case</span> <span class="number">0</span>:
        System.out.<span class="keyword">print</span>(<span class="string">"0"</span>);
    <span class="keyword">case</span> <span class="number">1</span>:
        System.out.<span class="keyword">print</span>(<span class="string">"1"</span>);
       <span class="comment">// break;</span>
    <span class="keyword">case</span> <span class="number">2</span>:
        System.out.<span class="keyword">print</span>(<span class="string">"2"</span>);
    <span class="keyword">case</span> <span class="number">3</span>:
        System.out.<span class="keyword">print</span>(<span class="string">"3"</span>);
    <span class="keyword">default</span>:
        System.out.<span class="keyword">print</span>(<span class="string">"default"</span>);
}
</code></pre>
            </div>

            <div class="warning-banner p-6 rounded-lg mb-8">
                <div class="flex items-start">
                    <i class="fas fa-exclamation-triangle text-yellow-600 text-2xl mr-4 mt-1"></i>
                    <div>
                        <h3 class="text-xl font-bold text-gray-800 mb-2">执行结果</h3>
                        <p class="text-gray-700">程序输出: <span class="font-mono font-bold text-red-600">123default</span></p>
                    </div>
                </div>
            </div>
        </section>

        <!-- Explanation Section -->
        <section class="mb-20">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 border-b pb-2 flex items-center">
                <i class="fas fa-lightbulb mr-3 text-yellow-500"></i>
                现象解析
            </h2>
            
            <div class="grid md:grid-cols-2 gap-8">
                <div class="bg-white p-8 rounded-xl shadow-md card-hover">
                    <div class="text-blue-500 text-4xl mb-4">
                        <i class="fas fa-random"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-4 text-gray-800">什么是case穿透？</h3>
                    <p class="text-gray-600 leading-relaxed">
                        在Java的switch语句中，当某个case匹配成功后，如果没有遇到break语句，程序会继续执行后续所有case中的代码，直到遇到break或switch语句结束。这种现象称为"case穿透"或"fall-through"。
                    </p>
                </div>
                
                <div class="bg-white p-8 rounded-xl shadow-md card-hover">
                    <div class="text-purple-500 text-4xl mb-4">
                        <i class="fas fa-exclamation-circle"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-4 text-gray-800">为什么会出现这种情况？</h3>
                    <p class="text-gray-600 leading-relaxed">
                        示例中num=1，匹配case 1后，由于没有break语句，程序会继续执行case 2、case 3和default中的代码。这种设计本意是为了允许多个case共享同一段代码，但如果不小心遗漏break，就会导致意外的行为。
                    </p>
                </div>
            </div>
        </section>

        <!-- Flow Chart -->
        <section class="mb-20">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 border-b pb-2 flex items-center">
                <i class="fas fa-project-diagram mr-3 text-green-500"></i>
                执行流程图解
            </h2>
            
            <div class="bg-white p-6 rounded-xl shadow-md">
                <div class="mermaid">
                    graph TD
                    A[开始] --> B[num=1]
                    B --> C{switch num}
                    C -->|0| D[输出"0"]
                    C -->|1| E[输出"1"]
                    E --> F[输出"2"]
                    F --> G[输出"3"]
                    G --> H[输出"default"]
                    C -->|2| I[输出"2"]
                    I --> G
                    C -->|3| J[输出"3"]
                    J --> H
                    C -->|其他| H
                    H --> K[结束]
                </div>
            </div>
        </section>

        <!-- Best Practices -->
        <section class="mb-20">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 border-b pb-2 flex items-center">
                <i class="fas fa-check-circle mr-3 text-green-500"></i>
                最佳实践
            </h2>
            
            <div class="grid md:grid-cols-3 gap-6">
                <div class="bg-white p-6 rounded-lg shadow-sm card-hover">
                    <div class="text-blue-500 text-2xl mb-3">
                        <i class="fas fa-code-branch"></i>
                    </div>
                    <h3 class="text-lg font-bold mb-3 text-gray-800">1. 总是使用break</h3>
                    <p class="text-gray-600 text-sm">除非有意实现多个case共享代码，否则每个case后都应添加break语句。</p>
                </div>
                
                <div class="bg-white p-6 rounded-lg shadow-sm card-hover">
                    <div class="text-purple-500 text-2xl mb-3">
                        <i class="fas fa-comment-alt"></i>
                    </div>
                    <h3 class="text-lg font-bold mb-3 text-gray-800">2. 明确注释</h3>
                    <p class="text-gray-600 text-sm">故意不使用break时，应添加注释说明，避免被误认为错误。</p>
                </div>
                
                <div class="bg-white p-6 rounded-lg shadow-sm card-hover">
                    <div class="text-green-500 text-2xl mb-3">
                        <i class="fas fa-exchange-alt"></i>
                    </div>
                    <h3 class="text-lg font-bold mb-3 text-gray-800">3. 考虑替代方案</h3>
                    <p class="text-gray-600 text-sm">对于复杂逻辑，考虑使用if-else或策略模式等替代方案。</p>
                </div>
            </div>
        </section>

        <!-- Fixed Example -->
        <section>
            <h2 class="text-3xl font-bold mb-8 text-gray-800 border-b pb-2 flex items-center">
                <i class="fas fa-check-square mr-3 text-blue-500"></i>
                修正后的代码
            </h2>
            
            <div class="code-block p-6 mb-6 overflow-x-auto">
                <pre><code>
<span class="keyword">int</span> num = <span class="number">1</span>;

<span class="keyword">switch</span> (num) {
    <span class="keyword">case</span> <span class="number">0</span>:
        System.out.<span class="keyword">print</span>(<span class="string">"0"</span>);
        <span class="keyword">break</span>;
    <span class="keyword">case</span> <span class="number">1</span>:
        System.out.<span class="keyword">print</span>(<span class="string">"1"</span>);
        <span class="keyword">break</span>;
    <span class="keyword">case</span> <span class="number">2</span>:
        System.out.<span class="keyword">print</span>(<span class="string">"2"</span>);
        <span class="keyword">break</span>;
    <span class="keyword">case</span> <span class="number">3</span>:
        System.out.<span class="keyword">print</span>(<span class="string">"3"</span>);
        <span class="keyword">break</span>;
    <span class="keyword">default</span>:
        System.out.<span class="keyword">print</span>(<span class="string">"default"</span>);
}
</code></pre>
            </div>
            
            <div class="bg-green-50 p-6 rounded-lg border border-green-200">
                <div class="flex items-center">
                    <i class="fas fa-check-circle text-green-500 text-2xl mr-4"></i>
                    <div>
                        <h3 class="text-lg font-bold text-gray-800 mb-1">修正后的输出</h3>
                        <p class="text-gray-700">程序输出: <span class="font-mono font-bold text-green-600">1</span></p>
                    </div>
                </div>
            </div>
        </section>
    </main>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-12">
        <div class="container mx-auto max-w-5xl px-4 md:px-0">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-bold text-white mb-2">技术小馆</h3>
                    <p class="text-gray-400">专业的编程技术学习平台</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-blue-400 hover:text-blue-300 transition duration-300 flex items-center">
                        <i class="fas fa-external-link-alt mr-2"></i>
                        www.yuque.com/jtostring
                    </a>
                </div>
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>
```